/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2025-04-07
 * Time: 15:35
 */
public class Demo20 {
    public static void main(String[] args) {
        Thread thread = Thread.currentThread();
        System.out.println(thread.getName());
        System.out.println("--------------");
        for(Thread.State state : Thread.State.values()){
            System.out.println(state);
        }
        System.out.println("------------");
        Thread t = new Thread(() -> {
            for (int i = 0; i < 100_0000; i++) {

            }
        },"李四");
        System.out.println(t.getName() + ":" + t.getState());
        t.start();
        while(t.isAlive()) {
            System.out.println(t.getName() + ":" + t.getState());
        }
        System.out.println(t.getName() + ":" + t.getState());

    }
}
